import { createAPI,createFormAPI } from "@/utils/request"

//查询部门列表
export const organList = data => createAPI('/company/department', 'get', data)
//保存部门信息
export const add = data => createAPI('/company/department', 'post', data)
//更新部门信息
export const update = data => createAPI(`/company/department/${data.id}`, 'put', data)
//根据id查询部门
export const find = data => createAPI(`/company/department/${data.id}`, 'get', data)
//根据id删除
export const deleteById = data => createAPI(`/company/department/${data.id}`, 'delete', 
data)

export const changeDept = data => createAPI(`/company/department/changeDept`, 'put', 
data)

//保存或更新
export const saveOrUpdate = data => {return data.id?update(data):add(data)}